<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="javax.naming.*,control.database.*"%>
<HTML><HEAD><TITLE>期末到达统计页面</TITLE>

<LINK href="Default.files/css.css" type=text/css rel=stylesheet>

<SCRIPT src="fPopUpCalendarDlg.js"></SCRIPT>

<SCRIPT language=javascript>
function check(){
	option.submit();
	return true;
	}



</SCRIPT>
</HEAD>
<BODY >

<%

String section="0";
section=(String)session.getAttribute("mger_code");
String mger_hostname=(String)session.getAttribute("mger_hostname");
java.util.Date   sysdate=new   java.util.Date();   
//sysdate.setMonth(sysdate.getMonth()-1);
String month=new SimpleDateFormat("yyyyMM").format(sysdate);

 

  if((request.getParameter("areacode")!=null))
  {
  section=request.getParameter("areacode");
  }
  %>

<FORM name=option action="month_report.jsp" method=post> 
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD vAlign=top align="center" colSpan=2>
							<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#f1f1f1 border=0>
								<TBODY>
									<TR height=40>
										<TD>
											<FONT color="#00ff80">
												<FONT color="#8000ff">
													 期末到达统计页面

												</FONT>
											</FONT>
										</TD>
										
										<TD align=right>
		 <%if(((String)session.getAttribute("mger_code")).equals("0")){%>
		 <select name="areacode" size=1>
         <%
          		DataBase db=new DataBase();
          		ResultSet rst=db.executeQuery("select * from mz_areacode where areaid=1 order by sortid");
          		while(rst.next()){
          %>
            <option value="<%=rst.getString("areacode")%>" <%if(section.equals(rst.getString("areacode")))out.print("selected");%>><%out.print(rst.getString("areaname"));%> </option>
            <%}
            rst.close();
            db.closeStmt();
	    	db.closeConn();
            
            %></select>
            <%}%>
            <INPUT type=button name=tongji value="统计" onclick="return check()"></TD>
          
									</TR>
								</TBODY>
							</TABLE>
							<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
								<TBODY>
									<TR>
										<TD>
											<TABLE id=dgDownLoad style="BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-COLOR: #cccccc; WIDTH: 100%; BORDER-TOP-COLOR: #cccccc; BORDER-COLLAPSE: collapse; BORDER-RIGHT-COLOR: #cccccc" borderColor=#cccccc cellSpacing=0 rules=all border=1>
												<TBODY>
													<TR style="BACKGROUND-COLOR: #d0ebee" align="center">
													    <TD style="WIDTH: 5%">
															<FONT color="#ff0080">&nbsp;日期</FONT>
														</TD>
														<TD style="WIDTH: 5%">
															<FONT color="#ff0080">&nbsp;地区名</FONT>
														</TD>
														<TD style="WIDTH: 5%">
															<FONT color="#ff0080">
														在网用户</FONT></TD>
														
														
														<TD style="WIDTH: 5%" align=left>
															<FONT color="#ff0080">&nbsp;
															上月已交费</FONT>
														</TD>
														<TD style="WIDTH: 5%" align=left>
															<FONT color="#ff0080">
														本月预收费用户</FONT>
														</TD>
													</TR>
													
												<%
											if(request.getParameter("today")==null){
										
					  String sql="sp_gol_monthFinal '"+section+"','"+month+"','"+mger_hostname+"'";						   
													Context initCtx = new InitialContext();
													
												    Context envCtx = (Context) initCtx.lookup("java:comp/env");
												    DataSource ds = (DataSource) envCtx.lookup("jdbc/TestDB");  
												    Connection conn = ds.getConnection();
												    Statement stmt = conn.createStatement();
													ResultSet rst = stmt.executeQuery(sql);
													
													while(rst.next()){
													%>
												
													<TR  align="center">
													<TD style="WIDTH: 5%" align=left>
																<FONT color="#8080ff">
																<%
												                  out.print(rst.getString("datemonth"));
												                  %>
																</FONT>
														
													</TD>
													<TD style="WIDTH: 5%" align=left>
																<FONT color="#8080ff">
																<%
																out.print(rst.getString("areaname"));
																%>
																</FONT>
														
														</TD>
														<TD style="WIDTH: 5%" align=left>
																<FONT color="#8080ff">
																<%
																	out.print(rst.getString("online"));
																	%>
																</FONT>
														
														</TD>
														<TD style="WIDTH: 5%" align=left>
															<FONT >
																
																<FONT color="#8080ff">
																	<%
																	out.print(rst.getString("feedeal"));
																	%>
																</FONT>
															</FONT>
														<TD style="WIDTH: 5%" align=left>
															<FONT >
																
																<FONT color="#8080ff">
																	<%
																	out.print(rst.getString("feeplan"));
																	%>																
																</FONT>
															</FONT>
														</TD>

													</TR>
													<%}
													rst.close();
													stmt.close();
													conn.close();
												}
												
												%>
												</TBODY>
											</TABLE>
										</TD>
									</TR>
								</TBODY>
							</TABLE>
						</TD></TR>
  <TR>
    <TD height=20>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
        <TBODY>
        <TR>
          <!-- TD width=180><IMG height=40 
            src="Default.files/main_bottom_pic01.gif" width=180></TD-->
          <TD width="40%" background=Default.files/main_bottom_bg.gif></TD>
          <TD align=right background=Default.files/main_bottom_bg.gif>
            <TABLE style="FONT-SIZE: smaller; FONT-FAMILY: 宋体" cellSpacing=0 
            cellPadding=0 width="100%" align=center border=0>
              <TBODY>
              <TR>
                <!-- TD noWrap>共有<FONT style="COLOR: red"></FONT>条记录&nbsp;</TD-->
                <TD noWrap>当前为<FONT 
                  style="COLOR: red; FONT-FAMILY: 宋体"><%if(request.getParameter("today")==null)out.print("1");else out.print("0");%></FONT>/<FONT 
                  style="COLOR: red; FONT-FAMILY: 宋体"><%if(request.getParameter("today")==null)out.print("1");else out.print("0");%></FONT>页</TD>
                <TD noWrap align=right><INPUT style="BORDER-RIGHT: blue 1px; BORDER-TOP: blue 1px; FONT-SIZE: 12pt; BORDER-LEFT: blue 1px; CLIP: rect(auto auto auto auto); CURSOR: hand; COLOR: blue; BORDER-BOTTOM: blue 1px; FONT-FAMILY: Webdings; HEIGHT: 20px; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" disabled onclick="__doPostBack('pageHelper','first')" type=button value=9><INPUT style="BORDER-RIGHT: blue 1px; BORDER-TOP: blue 1px; FONT-SIZE: 12pt; BORDER-LEFT: blue 1px; CLIP: rect(auto auto auto auto); CURSOR: hand; COLOR: blue; BORDER-BOTTOM: blue 1px; FONT-FAMILY: Webdings; HEIGHT: 20px; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" disabled onclick="__doPostBack('pageHelper','prev')" type=button value=3><INPUT style="BORDER-RIGHT: blue 1px; BORDER-TOP: blue 1px; FONT-SIZE: 12pt; BORDER-LEFT: blue 1px; CLIP: rect(auto auto auto auto); CURSOR: hand; COLOR: blue; BORDER-BOTTOM: blue 1px; FONT-FAMILY: Webdings; HEIGHT: 20px; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" disabled onclick="__doPostBack('pageHelper','next')" type=button value=4><INPUT style="BORDER-RIGHT: blue 1px; BORDER-TOP: blue 1px; FONT-SIZE: 12pt; BORDER-LEFT: blue 1px; CLIP: rect(auto auto auto auto); CURSOR: hand; COLOR: blue; BORDER-BOTTOM: blue 1px; FONT-FAMILY: Webdings; HEIGHT: 20px; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" disabled onclick="__doPostBack('pageHelper','last')" type=button value=:>
               </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM></BODY></HTML>
